package Offer2018;

/**
 * 单例模式 懒汉式
 * Created by 雷文康 on 2018/3/3.
 */
public class Test02a {

    private volatile static Test02a instance;

    private Test02a() {

    }

    public static Test02a getInstance() {
        if (instance == null) {
            synchronized (Test02a.class) {
                if (instance == null) {
                    instance = new Test02a();
                }
            }
        }
        return instance;
    }
}
